<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="complaintId" value="#{complaintHome.id}"></f:viewParam>
	   	<f:event listener="#{complaintHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="投诉管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="投诉管理" style="margin-bottom:10px;">
		       <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        
		        <h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel value="标题" />
					<h:outputText value="#{complaintHome.instance.title}" />
					
					<p:outputLabel value="内容"></p:outputLabel>
					<h:outputText value="#{complaintHome.instance.content}" />
					
					<p:outputLabel value="联系方式"></p:outputLabel>
					<h:outputText value="#{complaintHome.instance.contactInfo}" />
					
					<p:outputLabel value="上报时间"></p:outputLabel>
					<h:outputText value="#{complaintHome.instance.createDate}">
						<f:convertDateTime pattern="yyyy-MM-dd HH"/>
					</h:outputText>
						   
					<p:outputLabel for="handleResult" value="处理结果" />				
					<p:inputTextarea id="handleResult" 
								  value="#{complaintHome.instance.handleContent}"
						   	   required="true"
						   	   		rows="5"
						   	   		cols="80">
					</p:inputTextarea>					
				</h:panelGrid>
			</p:panel>
			
			<p:commandButton action="#{complaintHome.saveAndFlush()}" value="保存" ajax="false">
				<f:setPropertyActionListener value="#{true}" target="#{complaintHome.instance.handled}"></f:setPropertyActionListener>
			</p:commandButton>
			<p:commandButton value="删除" action="#{complaintHome.delete()}">
				<p:confirm header="请确认" message="您确认删除记录吗?" icon="ui-icon-alert" />
			</p:commandButton>
			<p:commandButton action="#{complaintHome.cancel()}" value="取消" immediate="true"></p:commandButton>	
						
			<p:confirmDialog id="confirmDialog" global="true" showEffect="fade" hideEffect="explode" widgetVar="confirmDialog">
			    <p:commandButton value="确认" styleClass="ui-confirmdialog-yes"></p:commandButton>
			    <p:commandButton value="取消" immediate="true" styleClass="ui-confirmdialog-no" />
			</p:confirmDialog>
		</h:form>
      
   	</ui:define>
</ui:composition>
